<?php
/**
* Preview Real Estate
* @author trungdt
* @since Jul 4, 2011
* 
* Change logs
* 
*/

if (!defined('EXPONENT')) exit('');

$bds = null;

///if (exponent_permissions_check('administrate',$loc) || ($bds && exponent_permissions_check('edit',$loc)) || (!$bds && exponent_permissions_check('create',$loc))) {
if (exponent_users_isLoggedIn()){ // just logged in is enought
	$bds = bds_bds::update($_REQUEST,$bds, $loc);
	$bds->location_data = serialize($loc);
	    
    $config=$db->selectObject("bdsmodule_config","location_data = '".serialize($loc)."'");
    
    // process
    $bds=array($bds);
    $bds=bdsmodule::_bdsProcess($bds);
    
    // assign to template
    $template = new template('bdsmodule',"_view_detail",$loc);
    $template->assign('project', array_pop($bds));
    $template->assign('config', $config);
    $template->output();
} else {
	echo ""; // nothing to return. Just return empty string
}

?>